project(yolov7)
cmake_minimum_required(VERSION 3.16)
set(CMAKE_BUILD_TYPE Release)

set(TARGETNAME ${PROJECT_NAME})

find_package(OpenCV REQUIRED)

set(SRCS "./main.cpp" 
        "src/Trt.cpp"
        "src/preprocess.cpp" 
        "src/postprocess.cpp"
        "utils/Bbox.cpp"
        "utils/nms.cpp"
        "utils/viz.cpp")

add_executable(${TARGETNAME} ${SRCS})

target_include_directories(${TARGETNAME} PUBLIC ${CMAKE_SOURCE_DIR}
    "/workspace/package/TensorRT-8.4.0.6/include"
    "/usr/local/cuda-11.4/targets/aarch64-linux/include"
    )

target_link_directories(${TARGETNAME} PUBLIC 
    "/workspace/package/TensorRT-8.4.0.6/lib"
    "/usr/local/cuda-11.4/targets/aarch64-linux/lib/"
    )

target_link_libraries(${TARGETNAME} nvinfer nvonnxparser cuda cudart ${OpenCV_LIBS})
set_target_properties(${TARGETNAME} PROPERTIES LINK_FLAGS "-Wl,-rpath,/workspace/package/cudnn-linux-x86_64-8.8.0.121_cuda11-archive/lib")